<%@ page language="java" pageEncoding="UTF-8" buffer="16kb"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<%@ include file="/module/js.jsp"%>
<%@ include file="/module/orderField.jsp"%>
 
<style>

table label.error {
    margin-left: 5px;
    width: auto;
    display: inline;
    color: red;
}
</style>







</head>
<body>
     <form action="#" name="Form" id="Form" method="post">
		    <table cellpadding="0" cellspacing="0" border="0" class="table-border" width="95%" >
			<tr>
				<td class="table-header" colspan="4">社团活动申请</td>
			</tr>
				<tr>
					<td class="table-titleTD" style="width: 15%"><font style="color: red;">*</font>社团名称:</td>
					<td class="table-contentTD" style="width: 35%">
				     	  <select id="stid" name="stid" class="selectList required" >
					         <option value="">全部</option>
					         <c:forEach items="${liststmc}" var="data">
							      <option value="${data.stid}">${data.stmc}</option>
						     </c:forEach>
						  </select>     
					</td>
			
			      <td class="table-titleTD" style="width: 15%">活动名称:</td>
				  <td class="table-contentTD">
					  <input type="text" id="hdmc" name="hdmc" placeholder="活动名称" autocomplete="off"  maxlength="100" class="inputText" /></td>
				  </tr>
			<tr>
			    <td class="table-titleTD" style="width: 15%"><font style="color: red;">*</font>活动日期:</td>
			    <td class="table-contentTD">
				     <input name="beginTime1" id="beginTime1" placeholder="活动日期"   autocomplete="off" 
									class="Wdate text  required inputText2" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/></td>
				</td>
				
                <td class="table-titleTD" style="width: 15%"><font style="color: red;">*</font>活动时间:</td>
			    <td class="table-contentTD">
			        <input type="text" id="hdsj" name="hdsj" placeholder="活动时间" autocomplete="off"  maxlength="30" class="inputText required" /></td>
				</td>
			</tr>
		    <tr>
				     <td class="table-titleTD" style="width: 15%"><font style="color: red;">*</font>活动地点:</td>
					 <td class="table-contentTD">
						  <input type="text" id="hddd" name="hddd" placeholder="活动地点" autocomplete="off"  maxlength="100" class="inputText required" /></td>
					
				    <td class="table-titleTD" style="width: 15%">状态：</td>
					<td class="table-contentTD">
						<select id="states" name="states" class="selectList">
								  <option value="0">未提交</option>
						</select>
					</td>
			</tr>
			
			<tr>
			    <td class="table-titleTD" style="width: 15%">申请人:</td>
			    <td class="table-contentTD">
			    <input type="hidden" name="creatorid" id="creatorid"  value="${xsid}"/>
				<input type="text" id="creatorname" name="creatorname" placeholder="申请人"  readonly="readonly"  autocomplete="off" value="${xsxm}" maxlength="8" class="inputText" /></td>
		           <td class="table-contentTD" colspan="2"></td>
			</tr>
			
			<tr>
				<td class="table-titleTD"><font style="color: red;">*</font>活动内容:</td>
				<td class="table-contentTD" colspan="3" style="width: 100%"><textarea style="width: 90%;height: 80px;" name="hdnr"  autocomplete="off"  class="required"  placeholder="活动内容" id="hdnr" maxlength="2000" ></textarea></td>
			</tr>
			<tr>
				<td class="table-titleTD">备注:</td>
				<td class="table-contentTD" colspan="3" style="width: 100%"><textarea style="width: 90%;height: 80px;" name="remark" autocomplete="off" placeholder="备注" id="remark" maxlength="2000" ></textarea></td>
			</tr>
		</table>
		 </form> 
		<br />
		
		<table cellpadding="1" cellspacing="1" border="0" align="left">
			<tr>
			    <td><input type="button" id="btnSave" class="inputButton"  autocomplete="off" 
					style="text-align: center;" value="保存" /></td>
				<td><input type="button" id="btnSaveContinue" class="inputButton" autocomplete="off" 
					style="text-align: center;" value="保存并新增" /></td>
				<td><input type="button" id="Cancel" class="inputButton" autocomplete="off"
					style="text-align: center;" value="取消" /></td>
				<td><input type="button" id="returnBut" class="inputButton" autocomplete="off"
					value="返回" style="text-align: center;" /></td>
			</tr>
		 </table>
		
		 
			
		<script>
			$(document).ready(function() {
				var _form=$("#Form").validate();
				$("#btnSave").click(function() {
					if(_form.form()){
						validataSave();
					}
				});
				
				$("#btnSaveContinue").click(function() {
					if(_form.form()){
						  validataSaveContinue();
					}
				});
				
				function validataSave(){
				  /* 	$.ajax({
						  type: 'POST',
						  url: "${basePath}/twglStudentCadre/validation",
					      data:{xmmc : $('#xmmc').val(),id:null},
						  success:function(data){
						   if(data.msg=="-99"){
							     layer.alert('服务器异常', {icon: 5});
							     return false;
						   }else if(data.msg!='0'){
							     layer.alert('申请人名称已经存在请重新输入', {icon: 5});
							     return false;
						   }else{ */
							    document.Form.action ="${basePath}/twglStudentCorpActivity/add";
								document.Form.submit();
						  /*  }   
						  }
						});	 */
				}
				
				
				function validataSaveContinue(){
				  /* 	$.ajax({
						  type: 'POST',
						  url: "${basePath}/twglStudentCadre/validation",
					      data:{xmmc : $('#xmmc').val(),id:null},
						  success:function(data){
						   if(data.msg=="-99"){
							     layer.alert('服务器异常', {icon: 5});
							     return false;
						   }else if(data.msg!='0'){
							     layer.alert('申请人名称已经存在请重新输入', {icon: 5});
							     return false;
						   }else{ */
							    document.Form.action ="${basePath}/twglStudentCorpActivity/addSaveContinue";
								document.Form.submit();
						 /*   }   
						  }
						});	 */
				}
				$("#returnBut").click(function() {
		 			   window.location.href='${basePath}/twglStudentCorpActivity/index';
		 		});
				
				$("#Cancel").click(function() {
					   window.location.href = "${basePath}/twglStudentCorpActivity/addInInt";
		 		});
			});
			
			   if("${msg}"!=""){
			       layer.alert("${msg}", {icon: 6});
			  } 
		</script>
</body>
</html>
